/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.system.entity;

import com.thinkgem.jeesite.modules.sys.entity.Office;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 钉钉接入管理Entity
 * @author jyangye
 * @version 2018-05-11
 */
public class VivoDingConf extends DataEntity<VivoDingConf> {
	
	private static final long serialVersionUID = 1L;
	private Office comp;		// 组织机构ID
	private String corpId;		// CorpId
	private String corpSecret;		// CorpSecret
	private String accessToken;		// AccessToken
	private Date accTokenTime;		// AccessToken时间
	private String ticket;		// JsApiTicket
	private Date ticketTime;		// ticket上次获取时间
	private String isActive;		// 是否可用
	private String operator;		// 操作人

    private String agentId; // 应用ID
	
	public VivoDingConf() {
		super();
	}

	public VivoDingConf(String id){
		super(id);
	}

	@NotNull(message="组织机构ID不能为空")
	@ExcelField(title="组织机构ID", align=2, sort=20)
	public Office getComp() {
		return comp;
	}

	public void setComp(Office comp) {
		this.comp = comp;
	}
	
	@Length(min=1, max=32, message="CorpId长度必须介于 1 和 32 之间")
	@ExcelField(title="CorpId", align=2, sort=30)
	public String getCorpId() {
		return corpId;
	}

	public void setCorpId(String corpId) {
		this.corpId = corpId;
	}
	
	@Length(min=1, max=128, message="CorpSecret长度必须介于 1 和 128 之间")
	@ExcelField(title="CorpSecret", align=2, sort=40)
	public String getCorpSecret() {
		return corpSecret;
	}

	public void setCorpSecret(String corpSecret) {
		this.corpSecret = corpSecret;
	}
	
	@Length(min=0, max=32, message="AccessToken长度必须介于 0 和 32 之间")
	@ExcelField(title="AccessToken", align=2, sort=50)
	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="AccessToken时间", align=2, sort=60)
	public Date getAccTokenTime() {
		return accTokenTime;
	}

	public void setAccTokenTime(Date accTokenTime) {
		this.accTokenTime = accTokenTime;
	}
	
	@Length(min=0, max=64, message="JsApiTicket长度必须介于 0 和 64 之间")
	@ExcelField(title="JsApiTicket", align=2, sort=70)
	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="ticket上次获取时间", align=2, sort=80)
	public Date getTicketTime() {
		return ticketTime;
	}

	public void setTicketTime(Date ticketTime) {
		this.ticketTime = ticketTime;
	}


    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    @Length(min=0, max=1, message="是否可用长度必须介于 0 和 1 之间")
	@ExcelField(title="是否可用", align=2, sort=90)
	public String getIsActive() {
		return isActive;
	}

	public void setIsActive(String isActive) {
		this.isActive = isActive;
	}
	
	@Length(min=0, max=32, message="操作人长度必须介于 0 和 32 之间")
	@ExcelField(title="操作人", align=2, sort=100)
	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}
	
}